package psc.model.base.cliente;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import psc.model.base.acesso.EnderecoEmb;
import psc.model.base.basicas.Banco;

@Entity
@Table
public class Agencia {

	public Agencia() {
		
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id;

	@Column(name = "numero", nullable = false)
	private int numero;
	@ManyToOne(fetch = FetchType.EAGER, cascade = { CascadeType.ALL })
	@JoinColumn(name = "banco_id", nullable = false)
	private Banco banco;

	@Embedded
	private EnderecoEmb endereco;

	public EnderecoEmb getEndereco() {
		return endereco;
	}

	public void setEndereco(EnderecoEmb endereco) {
		this.endereco = endereco;
	}

	public Banco getBanco() {
		return banco;
	}

	public void setBanco(Banco banco) {
		this.banco = banco;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getNumero() {
		return numero;
	}

	public void setNumero(int numero) {
		this.numero = numero;
	}

}
